<template>
  <div>
    <h3>测试用组件</h3>
    <p v-abc>{{ uname }}</p>
  </div>
</template>

<script>
export default {
  props: ['uname'],
  directives: {
    abc: {
      bind (el) {
        el.style.color = 'blue'
      },
      update (el) {
        console.log(el.innerHTML) // uname更新之前的值
      },
      componentUpdated (el) {
        console.log(el.innerHTML) // uname更新之后的值
      }
    }
  }
}
</script>
